<?php
namespace module\app\validate;

use app\Validate;

/*
 *  邀请模型
 */
class UserInvite extends Validate
{
    protected $rule = [
        'aim_id' => 'require|integer|gt:0|exists:user,id',
        'page' => 'integer|>:0',
        'pageSize' => 'integer|>:0',
    ];
    protected $message = [
        'aim_id.unique' => '您已邀请该用户',
        'aim_id.exists' => '该用户不存在',
    ];    
    protected $field = [
        'aim_id' => '用户',
    ];    
    // save 验证场景定义
    public function sceneSave()
    {
    	return $this->only(['aim_id'])
        	->append('aim_id', 'unique:user_invite');
    }
    // del 验证场景定义
    public function sceneDel()
    {
    	return $this->only(['aim_id'])
        	->append('aim_id', 'exists:user_invite');
    }
}
